export default function createElement(type, props, ...children) {
    const childElements = [].concat(...children).reduce((pre, cur) => {
        if (cur !== false && cur !== null && cur !== true) {
            if (cur instanceof Object) {
                pre.push(cur)
            } else {
                pre.push(createElement("text", { textContent: cur }))
            }
        }
        return pre
    }, [])
    return {
        type,
        props: Object.assign({ children: childElements }, props),
        children: childElements
    }
}


